Random tidy-ups.
endif
ifeq ($(debugger),y)
-CFLAGS += -DXEN_DEBUGGER
+CFLAGS += -DXEN_DEBUGGER -g
endif
ifeq ($(perfc),y)
CC := gcc
LD := ld
-CFLAGS := -nostdinc -fno-builtin -fno-common -fno-strict-aliasing -O3
-CFLAGS += -iwithprefix include -Wall -Werror -fomit-frame-pointer -pipe
+CFLAGS := -nostdinc -fno-builtin -fno-common -fno-strict-aliasing
+CFLAGS += -iwithprefix include -Wall -Werror -pipe
CFLAGS += -I$(BASEDIR)/include -Wno-pointer-arith -Wredundant-decls
ifeq ($(TARGET_SUBARCH),x86_32)
LDFLAGS := --oformat elf32-i386
endif
+ifeq ($(debugger),y)
+CFLAGS += -O2
+else
+CFLAGS += -O3 -fomit-frame-pointer
+endif
+
ifeq ($(TARGET_SUBARCH),x86_64)
CFLAGS += -m64 -mno-red-zone -fpic -fno-reorder-blocks
CFLAGS += -fno-asynchronous-unwind-tables
return c - 'A' + 10;
else
BUG();
-}
-
-static unsigned char
-val_to_hex_char(unsigned val)
-{
- if (val < 10)
- return val + '0';
- else if (val < 16)
- return val - 10 + 'a';
- else
- BUG();
+ return -1;
}
/* Receive a command. Returns -1 on csum error, 0 otherwise. */
return;
}
xendbg_running = 1;
- /* trap_to_xendbg gets esp slightly wrong. Correct for this. */
- regs->esp += 8;
- dbg_printk("Waiting for GDB to attach to XenDBG\n");
- /* Urgg... hope this is right... */
+ /* Shouldn't really do this, but otherwise we stop for no
+ obvious reason, which is Bad */
+ printk("Waiting for GDB to attach to XenDBG\n");
+
while (resume == 0) {
r = receive_command(recv_buf);
if (r < 0) {
void initialize_xendbg(void);
-void trap_to_xendbg(void);
void cmain(multiboot_info_t *mbi)
{
shadow_mode_init();
- printk("Trapping to debugger.\n");
- trap_to_xendbg();
- printk("Trapped to debugger and came back.\n");
-
/*
* We're going to setup domain0 using the module(s) that we stashed safely
* above our heap. The second module, if present, is an initrd ramdisk.